
<script type="text/javascript">

$(document).ready(function() {
    var data = JSON.parse($(".s_temple_setting.head_image_settings").html());
    if(data.hasImage){
		$("#s_currcet_image").attr("src",data.imageurl);
		$("#s_hide_on_complete").html("如需更改头像，请点击下方模块上传新的");
    }
	checkImageUpdaterScript();
});
function onImageUpdaterScriptLoad(){
	$("#s_activity_image_updater").show();
	s_i_setURL("index.php?mod=home&childmod=setting&ajax=true&op=updateBlobHeadImage");
	s_i_load("s_activity_image_updater");

}
function image_update_callback(state,data){
    try {
        if(data["code"]==0){
        	showMessage("s_s_update_head_image",data["code"], data["message"]);
        	$("#s_currcet_image").attr("src",data.data);
        	
        	s_i_reset();
        	$("#s_activity_image_updater").hide();
        }
    	showMessage("s_s_update_head_image",data["code"], data["message"]);
    } catch(ex) {
    	showMessage("s_s_update_head_image",-31, err);
    }
}
</script>
<h2>头像设定</h2>
<div class="s_temple_setting head_image_settings"><?php print_json_setting("head_image_settings");?></div>
<div class="ui success message hidden" id="s_s_update_head_image"></div>
<div class="ui error message hidden" id="s_hide_on_complete">你还没有上传过头像，那是默认头像，请点击下方上传一个吧。</div>
<h5>你当前的头像</h5>
<img class="ui medium image" id="s_currcet_image">
<br />
<div class="box">
	<img class="ui medium bordered image" id="headimage">
</div>
<div id="s_activity_image_updater"></div>
